RRRRWWWWZZZZoooonnnneeeeSSSSiiiimmmmpppplllleeee is an implementation of the abstract interface defined by
class RRRRWWWWZZZZoooonnnneeee. It implements a simple daylight-saving time rule
sufficient to represent all historical U.S. conventions and many European
and Asian conventions. It is table-driven and depends on parameters
given by the struct RRRRWWWWDDDDaaaayyyylllliiiigggghhhhttttRRRRuuuulllleeee,,,, which is described below. Direct use
of RRRRWWWWDDDDaaaayyyylllliiiigggghhhhttttRRRRuuuulllleeee affords the most general interface to RRRRWWWWZZZZoooonnnneeeeSSSSiiiimmmmpppplllleeee.
However, a much simpler programmatic interface is offered, as illustrated
by the examples below. Three instances of RRRRWWWWZZZZoooonnnneeeeSSSSiiiimmmmpppplllleeee are automatically
constructed at program startup, to represent UTC, Standard, and local
time. They are available via calls to the static member functions
RRRRWWWWZZZZoooonnnneeee::::::::uuuuttttcccc(((()))), RRRRWWWWZZZZoooonnnneeee::::::::ssssttttaaaannnnddddaaaarrrrdddd(((()))), and RRRRWWWWZZZZoooonnnneeee::::::::llllooooccccaaaallll(((()))), respectively.
These member functions are set up according to the time zone facilities
provided in the execution environment (typically defined by the
environment variable TTTTZZZZ). By default, if DST is observed at all, then
the local zone instance will use U.S. (RRRRWWWWZZZZoooonnnneeee::::::::NNNNooooAAAAmmmm) daylight-saving time
rules. NNNNooootttteeee ffffoooorrrr ddddeeeevvvveeeellllooooppppeeeerrrrssss oooouuuuttttssssiiiiddddeeee NNNNoooorrrrtttthhhh AAAAmmmmeeeerrrriiiiccccaaaa: for some time zones
this default will not be correct because these time zones rely on the C
standard global variable _ddddaaaayyyylllliiiigggghhhhtttt. This variable is set whenever any
alternate time zone rule is available, whether it represents daylight-
saving time or not. Also the periods of history affected by daylight-
saving time may be different in your time zone from those in North
America, causing the North American rule to be erroneously invoked. The
best way to ensure that these default time zones are correct is to
construct an RRRRWWWWZZZZoooonnnneeeeSSSSiiiimmmmpppplllleeee using an appropriate RRRRWWWWDDDDaaaayyyylllliiiigggghhhhttttRRRRuuuulllleeee and
initialize RRRRWWWWZZZZoooonnnneeee::llllooooccccaaaallll(((()))) and RRRRWWWWZZZZoooonnnneeee::::::::ssssttttdddd(((()))) with this value. Other
instances of RRRRWWWWZZZZoooonnnneeeeSSSSiiiimmmmpppplllleeee may be constructed to represent other time
zones, and may be installed globally using RRRRWWWWZZZZoooonnnneeee static member functions
RRRRWWWWZZZZoooonnnneeee::::::::llllooooccccaaaallll((((ccccoooonnnnsssstttt RRRRWWWWZZZZoooonnnneeee****)))) and RRRRWWWWZZZZoooonnnneeee::::::::ssssttttaaaannnnddddaaaarrrrdddd((((ccccoooonnnnsssstttt RRRRWWWWZZZZoooonnnneeee****)))).
PPPPeeeerrrrssssiiiisssstttteeeennnncccceeee
None
EEEExxxxaaaammmmpppplllleeeessss
To install US Central time as your global "local" time use:
Daylight-saving time systems that cannot be represented with
RRRRWWWWDDDDaaaayyyylllliiiigggghhhhttttRRRRuuuulllleeee and RRRRWWWWZZZZoooonnnneeeeSSSSiiiimmmmpppplllleeee must be modeled by deriving from RRRRWWWWZZZZoooonnnneeee
and implementing its virtual functions. For example, under Britain's
Summer Time rules, alternate timekeeping begins the morning after the
third Saturday in April, unless that is Easter (in which case it begins
the week before) or unless the Council decides on some other time for
that year. In some years Summer Time has been two hours ahead, or has
extended through winter without a break. British Summer Time clearly
deserves an RRRRWWWWZZZZoooonnnneeee class all its own.